/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

/**
 *
 * @author cxhd
 */
@SuppressWarnings("serial")
public class LisReference extends Model<LisReference>{
     public static final LisReference lisReferencedao=new LisReference();
     public void deleteLisRerence(String TESTID){
         Db.use("mysql").update("delete from lis_reference where TESTID=?",TESTID);
     }
//     public void saveLisRerence(String TESTPK,Controller con){
////        select PK,ITEMPK,REFAGE,SAMPLETYPEPK,MREFVAL0,FREFVAL0,DECIMALPLACE from lis_reference
//              set("TESTPK", Integer.valueOf(TESTPK))
//            .set("REFAGE", con.getPara("REFAGE"))
//            .set("SAMPLETYPEPK",Integer.valueOf(con.getPara("SAMPLETYPEPK")))
//            .set("MREFVAL0", con.getPara("MREFVAL0"))
//            .set("FREFVAL0", con.getPara("FREFVAL0"))
//            .set("DECIMALPLACE", con.getPara("DECIMALPLACE"))
//                 .save();
//                 
//     }
//     public void updateLisRerence(Controller con){
//         findById(Integer.valueOf(con.getPara("PK")))
//                .set("TESTPK", Integer.valueOf(con.getPara("TESTPK")))
//            .set("REFAGE", con.getPara("REFAGE"))
//            .set("SAMPLETYPEPK",Integer.valueOf(con.getPara("SAMPLETYPEPK")))
//            .set("MREFVAL0", con.getPara("MREFVAL0"))
//            .set("FREFVAL0", con.getPara("FREFVAL0"))
//            .set("DECIMALPLACE", con.getPara("DECIMALPLACE"))
//                 .update();
//     }
     public void saveRefs(String TESTID,String REFAGE,String SAMPLETYPEPK,String MREFVAL0,String FREFVAL0,String DECIMALPLACE){
          set("TESTID", TESTID)
            .set("REFAGE", REFAGE)
            .set("SAMPLETYPEPK",SAMPLETYPEPK)
            .set("MREFVAL0", MREFVAL0)
            .set("FREFVAL0", FREFVAL0)
            .set("DECIMALPLACE", DECIMALPLACE)
                 .save();
     }
}
